package project2.shared;

/**
 * <p>
 * FieldVerifier verifies that the text entered by the user is valid.
 * </p>
 * <p>
 * This class is in the <code>shared</code> package because we use it in both
 * the client code and on the server. On the client, we verify that the text is
 * valid before sending an RPC request so the user doesn't have to wait for a
 * network round trip to get feedback. On the server, we verify that the text is
 * correct to ensure that the input is correct regardless of where the RPC
 * originates.
 * </p>
 */
public class FieldVerifier
{

	/**
	 * Verifies that the specified text is valid for the web application.
	 * 
	 * It ensures that the text entered by the user is at least ten characters
	 * long.
	 * 
	 * @param text the text to validate.
	 * @return true if valid, false if invalid.
	 */
	public static boolean isValidText(String text)
	{
		if (text == null)
			return false;

		return text.length() > 9;
	}
}
